package com.ilab.service.impl;

import java.io.Serializable;
import java.util.List;

import org.hibernate.SessionFactory;
import org.springframework.transaction.annotation.Transactional;

import com.ilab.model.Department;
import com.ilab.service.DepartmentService;

@Transactional
public class DepartmentServiceImpl extends BasicAbstractService implements DepartmentService {

//	private SessionFactory sessionFactory;
//	
//	public void setSessionFactory(SessionFactory sessionFactory) {
//		this.sessionFactory = sessionFactory;
//	}
//
//	public void addDepartment(Department department) {
//		sessionFactory.getCurrentSession().save(department);
//	}
//
//	public Department getDepartmentById(Serializable id) {
//		
//		return (Department) sessionFactory.getCurrentSession().get(Department.class, id);
//	}

	public List listDepartments() {
		String hql = "from Department";
		
		return this.executeQuery(hql, null);
	}
}
